#README: advanced version of pic grabber, works through atomic2, modify board= to your need,
#in latest post that has pic attachments, the last pic attachment is saved
#use this with crontab (google it if not familiar) so robot runs every minute
#also, add a svn commit in the end, so all pic versions are revision controlled...

wget -O board.htm "http://www.newsmth.net/bbsdoc.php?board=picture"

postnum=`cat board.htm |grep " @" | tail -1 | sed -e "s/c\.o(//g" | sed -e "s/,.*);//g" ; `
rm -f board.htm

httpprefix="http://www.newsmth.net/atomic2.php?act=article&board=picture&id="
#act=article is fixed; board= pict*re/piel*ve/myph*to, etc need adjust to your needs

posthttp=$httpprefix$postnum
#echo $postnum
#echo $posthttp

wget -O post.htm $posthttp
pichttp=`cat post.htm |grep "att\.php" | tail -1 | sed -e "s/.*att\.php/http:\/\/www\.newsmth\.net\/att\.php/g" | sed -e "s/' target='_blank'.*//g"; `
rm -f post.htm
#echo $pichttp

wget -nd -r -A jpg $pichttp

rename -f "s/att\.php\?n\.//g" att*jpg
#rename is actually rename.pl in svn source code
#mogrify -resize 640x480 *.jpg
